CommandSelect Class Reference

#include <CommandSelect.h>

Inheritance diagram for CommandSelect:

Command List of all members.

Public Member Functions

 CommandSelect (int isMultipleSelection, TraffEduObject *obj, OSGWindows *osgwind)
bool execute ()
bool unexecute ()
void changeState ()
void changeStateReverse ()

Private Attributes

OSGWindows * osgwind_
vector< TraffEduObject * > selectedObjs_
vector< TraffEduObject * > tmpObjs_
osg::StateSet * stateset
int isMultip

Detailed Description

Definition at line 8 of file CommandSelect.h.


Constructor & Destructor Documentation

CommandSelect::CommandSelect (  int  isMultipleSelection,
TraffEduObject *  obj,
OSGWindows *  osgwind
) 
 

A constructor. Initializes isMultipleSelection and osgwind_ variables.

Parameters:
isMultipleSelection an integer argument.
obj a TraffEduObject pointer.
osgwind an OSGWindows pointer.

Definition at line 2 of file CommandSelect.cpp.

References OSGWindows::getSelectedObjects(), isMultip, osgwind, osgwind_, selectedObjs_, and tmpObjs_.


Member Function Documentation

void CommandSelect::changeState (   ) 
 

highlight the selected objects in the environment.

Definition at line 59 of file CommandSelect.cpp.

References stateset.

void CommandSelect::changeStateReverse (   ) 
 

un_highlight the selected objects in the environment.

Definition at line 67 of file CommandSelect.cpp.

References stateset.

Referenced by execute().

bool CommandSelect::execute (   )  [virtual]
 

do the selection operation.

Returns:
Operation success

Implements Command.

Definition at line 13 of file CommandSelect.cpp.

References changeStateReverse(), OSGWindows::clearSelectedObjects(), OSGWindows::getObjects(), isMultip, osgwind, osgwind_, selectedObjs_, OSGWindows::setSelectedObjects(), stateset, and tmpObjs_.

Referenced by OSGWindows::addCommandSelect().

bool CommandSelect::unexecute (   )  [virtual]
 

undo the selection operation.

Returns:
Operation success

Implements Command.

Definition at line 52 of file CommandSelect.cpp.


Member Data Documentation

int CommandSelect::isMultip [private]
 

a private variable. It shows if the user intended to make multiple selection or not.

Definition at line 40 of file CommandSelect.h.

Referenced by CommandSelect(), and execute().

OSGWindows* CommandSelect::osgwind_ [private]
 

a private variable. It is initialized with the unique OSGWindows instance.

Definition at line 16 of file CommandSelect.h.

Referenced by CommandSelect(), and execute().

vector<TraffEduObject*> CommandSelect::selectedObjs_ [private]
 

a private vector of TraffEduObjects. It holds the selected objects.

Definition at line 22 of file CommandSelect.h.

Referenced by CommandSelect(), and execute().

osg::StateSet* CommandSelect::stateset [private]
 

a private osg::StateSet pointer. It holds state of the selected/deselected objects.

Definition at line 34 of file CommandSelect.h.

Referenced by changeState(), changeStateReverse(), and execute().

vector<TraffEduObject*> CommandSelect::tmpObjs_ [private]
 

a private vector of TraffEduObjects. It holds the selected objects before the last selection operation.

Definition at line 28 of file CommandSelect.h.

Referenced by CommandSelect(), and execute().


The documentation for this class was generated from the following files:
Generated on Sun May 28 18:54:12 2006 for TraffEdu by  doxygen 1.4.6-NO